/*
   DEOServer_main.m created by enoyau on Fri 13-Jan-1995

   You may freely copy, distribute, and reuse the code in this example.
   NeXT disclaims any warranty of any kind, expressed or implied, as to its
   fitness for any particular use.
*/

#import "DEOServer.h"

#import <foundation/NSAutoreleasePool.h>
#import <foundation/NXAutoreleaseConnection.h>

#import <machkit/NXPort.h>

#define SECOND (1000)
#define MINUTE (60 * SECOND)

int main(int argc, char *argv[]) {
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    DEOServer *myServer = [[[DEOServer alloc] init] autorelease];
    NXAutoreleaseConnection *myConnection = [NXAutoreleaseConnection registerRoot:myServer withName:DEOServerName];

    [NXPort worryAboutPortInvalidation];
//    [myConnection registerForInvalidationNotification:myServer];

    do {
        [myConnection runWithTimeout:2 * MINUTE];
        
    } while([myServer hasClient]);

    [myConnection free];
    [pool release];
    return 0;
}
